package deep7jvmdvm;

/*
Java 内存模型与线程
https://blog.csdn.net/ChinaDragon10/article/details/125884509?csdn_share_tail=%7B%22type%22%3A%22blog%22%2C%22rType%22%3A%22article%22%2C%22rId%22%3A%22125884509%22%2C%22source%22%3A%22ChinaDragon10%22%7D&ctrtid=fgK2e

指令重排

javac -encoding utf-8 TestJMM2.java

javap -v TestJMM2.class




 */
public class TestJMM2 {

    public static void main(String[] args) {
       int a = 1;
       int b = 2;
        a = a + 1;

        //public static void main(java.lang.String[]);
        //    descriptor: ([Ljava/lang/String;)V
        //    flags: (0x0009) ACC_PUBLIC, ACC_STATIC
        //    Code:
        //      stack=2, locals=3, args_size=1
        //         0: iconst_1
        //         1: istore_1
        //         2: iconst_2
        //         3: istore_2
        //         4: iload_1
        //         5: iconst_1
        //         6: iadd
        //         7: istore_1
        //         8: return

    }
}
